<?php
	ob_start();
	error_reporting( 0 );
	
	require_once('config.php');
	include_once('function.php');	
	
	// Create connection
	$con = connectDB($host,$user,$pass,$db);	
	
	$html_data = array();
	// generate products with size | quantity	
	$html_data = generateProductsArray($con);					
	
	// print excel file - test only
	if(isset($_GET['type']))
	{
		printExcel($html_data, 'products_'.date('d-m-Y'));
	}
	else
	{
		printExcel2($html_data, 'products_'.date('d-m-Y'));
	}